#Goal for this example:

#build cuda and cpp sources that require C++11 to be enabled.

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CUDA_STANDARD 11)

set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CUDA_STANDARD_REQUIRED TRUE)

add_library(static_cuda11 STATIC static.cu)

add_library(static_cpp11 STATIC static.cpp)
target_link_libraries(static_cpp11 PRIVATE static_cuda11)

add_executable(cpp11 main.cpp)
target_link_libraries(cpp11 PRIVATE static_cpp11)

set(CMAKE_CXX_STANDARD 98)
set(CMAKE_CUDA_STANDARD 98)
